how to print first character of a string in java